package com.cx.service.yitu.service;


import com.cx.service.yitu.entity.EditRepositoryForm;
import okhttp3.MultipartBody;
import okhttp3.ResponseBody;
import org.json.JSONObject;
import org.springframework.stereotype.Service;
import retrofit2.Call;
import retrofit2.http.*;


/**
 * @ClassName: RetrofitService
 * @Description: 依图盒子接口（老版）
 * @Author: cx
 * @Date: 2023/10/17 15:44
 **/
@Service
public interface YiTuService {

    @Headers("Content-Type:application/json")
    @PUT("face/v1/repositories/{id}")
    Call<String> editOrInsertReopositoryNew(@Path("id") String id, @Body EditRepositoryForm param);


    //    根据人像库id获取人像库信息
    @GET("face/v1/repositories/{id}")
    Call<com.alibaba.fastjson.JSONObject> getImageLibrary(@Path("id") String id);


    //根据dbimage_url获取图片
    @Streaming
    @GET("face/v1/images/{imageId}")
    Call<ResponseBody> downloadPicWithUrl(@Path("imageId") String imageId);


    //图片上传(旷世接口)
    @Multipart
    @Headers("Content-Type:multipart/form-data")
    @POST(" /v1/api/person/uploadImage")
    Call<JSONObject> uploadImage(@Part MultipartBody.Part file);

}
